package org.shiro.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.shiro.entity.RolePermission;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author HKC
 */
@Repository
@Mapper
public interface RolePermissionMapper {
  /**
   * 删除
   * @param id
   * @return
   */
  int deleteByPrimaryKey(Long id);

  /**
   * 添加
   * @param record
   * @return
   */
  int insertSelective(RolePermission record);

  /**
   * 查询
   * @param id
   * @return
   */
  RolePermission selectByPrimaryKey(Long id);

  /**
   * 更改
   * @param record
   * @return
   */
  int updateByPrimaryKeySelective(RolePermission record);

  /**
   * 添加权限Id
   * @param roleId
   * @param permissionIds
   * @return
   */
  int insertPermission(@Param("roleId") Long roleId, @Param("permissionId") List<Long> permissionIds);
}
